package com.cgy.weixin.api;

import com.cgy.weixin.model.response.CheckPhoneResponse;
import com.cgy.weixin.model.response.LoginResponse;
import com.cgy.weixin.model.response.RegisterResponse;
import com.cgy.weixin.model.response.SendCodeResponse;
import com.cgy.weixin.model.response.VerifyCodeResponse;

import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by cgy
 * 2018/5/25  10:53
 */
public interface MyApi {
    public static final String BASE_URL = "http://api.sealtalk.im/";

    //检查手机是否被注册
    @POST("user/check_phone_available")
    Observable<CheckPhoneResponse> checkPhoneAvailable(@Body RequestBody body);

    //发送验证码
    @POST("user/send_code")
    Observable<SendCodeResponse> sendCode(@Body RequestBody body);

    //验证验证码是否正确(必须先用手机号码调sendCode)
    @POST("user/verify_code")
    Observable<VerifyCodeResponse> verifyCode(RequestBody body);

    //注册
    @POST("user/register")
    Observable<RegisterResponse> register(@Body RequestBody body);

    //登录
    @POST("user/login")
    Observable<LoginResponse> login(@Body RequestBody body);


}
